import { Login } from "@/api/interface/index";
import { DEFAULT_SERVICE } from "@/api/config/servicePort";
// import authMenuList from "@/assets/json/authMenuList.json";
// import systemMenuList from "@/assets/json/systemMenuList.json";
import http from "@/api";
// import { useUserStore } from "@/stores/modules/user";

/**
 * @name 登录模块
 */
// 用户登录
export const getAuthCode = () => {
  return http.post<Login.ResAuthCode>(DEFAULT_SERVICE + `/login/getAuthCode`, {}, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 用户登录
export const loginApi = (params: Login.ReqLogin) => {
  return http.post<Login.ResLogin>(DEFAULT_SERVICE + `/login/login`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};

// 用户退出登录
export const logoutApi = () => {
  return http.post(DEFAULT_SERVICE + `/login/logout`);
};
